import React from 'react';
import { connect } from 'react-redux';
import InvoiceBagGroup from './invoice-bag-group';
import InvoiceBagCompany from './invoice-bag-company';

class InvoiceBag extends React.Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    return <div>
      {this.props.tenantMode ? <InvoiceBagGroup/> : <InvoiceBagCompany/>}
    </div>;
  }
}

InvoiceBag.contextTypes = {
  router: React.PropTypes.object
};

function mapStateToProps(state) {
  return {
    company: state.login.company,
    tenantMode: state.main.tenantMode,
  };
}

export default connect(mapStateToProps)(InvoiceBag);
